﻿#include<iostream>
using namespace std;

void Sort(int a[4]) {
	cout << sizeof(a) << endl;//8，因为int a[4]被当成指针了
}

void Sort(int a[], unsigned count) {//可以写为void Sort(int* a, unsigned count)
	for (int i = 1; i < count; i++) {
		for (int y = 1; y < count; y++) {
			if (a[y] > a[y - 1]) {
				int tmp = a[y - 1];
				a[y - 1] = a[y];
				a[y] = tmp;
			}
		}
	}
}

void Sort(int a[]) {
	a[0] = 1;
}

void Sort(int a[][2], unsigned count) {
	cout << a[count][2] << endl;
}


int main() {
	int b[]{ 230,234,1234,4576,255 };
	int a[5]{ 230,234,1234,4576,255 };

	int c[3][2]{ {1,2},{3,4},{5,6} };

	Sort(a, 5);

	Sort(a, 1);

	cout << a[0] << endl;//230
	Sort(a);
	cout << a[0] << endl;//1，由此可以知道数组传参函数中的改变会影响原本数组

	for (auto x : a)
		cout << x << endl;
}